<?php


namespace App\Services;


class RequestService
{

    public function checkSearchData ($id, $content, $taskId, $questionType, $questionNum)
    {
        if (!$taskId) {
            throw new \RuntimeException('请输入对应的 task_id');
        }

        if (!$id && !$content) {
            throw new \RuntimeException('为传入搜索的id或搜索的题干');
        }

        if ($questionType !== 'single' && !$questionNum) {
            throw new \RuntimeException('套卷中需要传入对应的题号');
        }
    }

    // 检查task的传参
    public function checkTaskRequest ($content)
    {
        if (!$content['operator_id']) {
            throw new \RuntimeException('没有传入要查询的操作员id');
        }
    }

    public function checkSaveQuestion ($taskId, $type, $content)
    {
        /*if (!) {
            throw new RuntimeException('没有传入要任务操作id');
        }*/
    }
}